package gk.cxd.friday.service;

import gk.cxd.friday.common.result.TableDataInfo;
import gk.cxd.friday.model.SysRole;
import gk.cxd.friday.model.vo.SysRoleVO;
import org.springframework.data.domain.Pageable;


import javax.transaction.Transactional;
import java.util.List;
import java.util.Set;

/**
 * 角色业务处理
 */
public interface SysRoleService {
    /*** 查询角色列表 */
    List<SysRole> selectRoleAll();

    List<Long> selectRoleListByUserId(Long userId);

    Set<String> selectRolePermissionByUserId(Long userId);
    /**
     * 分页与模糊查询
     */
    TableDataInfo selectRoleList(SysRoleVO role, Pageable page);

    /*检查角色名称、检查角色Key值、插入角色信息*/
    String checkRoleNameUnique(SysRoleVO role);

    String checkRoleKeyUnique(SysRoleVO role);

    int insertRole(SysRoleVO role);

    @Transactional
    int deleteRoleByIds(Long[] roleIds);

    @Transactional
    void checkRoleAllowed(SysRoleVO role);

    SysRole selectRoleById(Long roleId);

    int countUserRoleByRoleId(Long roleId);

    /*修改用户*/
    @Transactional
    int updateRole(SysRoleVO role);

    /*获取角色状态修改*/
    @Transactional
    int updateRoleStatus(SysRoleVO role);
}
